package com.itheima.demo4;

import java.io.File;

public class FileDemo3 {
    public static void main(String[] args) {

        File file = new File("C:\\Users\\DZL\\Desktop\\c");

        //获取File文件夹内的所有内容并将其放入数组中
        File[] files = file.listFiles();
        for (File file1 : files) {
            System.out.println(file1);
        }



        File[] arr = File.listRoots();
        for (File file1 : arr) {
            System.out.println(file1);
        }
    }
}
